home *** CD-ROM | disk | FTP | other *** search
/ Stone Design / Stone Design.iso / Stone_Friends / Wave / WavesWorld / Source / Libraries / tcl7.4b3 / doc / lsearch.n < prev    next >
Encoding:
Text File  |  1994-12-17  |  1.4 KB  |  48 lines

  1. '\"
  2. '\" Copyright (c) 1993 The Regents of the University of California.
  3. '\" Copyright (c) 1994 Sun Microsystems, Inc.
  4. '\"
  5. '\" See the file "license.terms" for information on usage and redistribution
  6. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  7. '\" 
  8. '\" @(#) lsearch.n 1.3 94/12/17 16:18:30
  9. '\" 
  10. .so man.macros
  11. .HS lsearch tcl 7.0
  12. .BS
  13. '\" Note:  do not modify the .SH NAME line immediately below!
  14. .SH NAME
  15. lsearch \- See if a list contains a particular element
  16. .SH SYNOPSIS
  17. \fBlsearch \fR?\fImode\fR? \fIlist pattern\fR
  18. .BE
  19.  
  20. .SH DESCRIPTION
  21. .PP
  22. This command searches the elements of \fIlist\fR to see if one
  23. of them matches \fIpattern\fR.
  24. If so, the command returns the index of the first matching
  25. element.
  26. If not, the command returns \fB\-1\fR.
  27. .VS
  28. The \fImode\fR argument indicates how the elements of the list are to
  29. be matched against \fIpattern\fR and it must have one of the following
  30. values:
  31. .TP
  32. \fB\-exact\fR
  33. The list element must contain exactly the same string as \fIpattern\fR.
  34. .TP
  35. \fB\-glob\fR
  36. \fIPattern\fR is a glob-style pattern which is matched against each list
  37. element using the same rules as the \fBstring match\fR command.
  38. .TP
  39. \fB\-regexp\fR
  40. \fIPattern\fR is treated as a regular expression and matched against
  41. each list element using the same rules as the \fBregexp\fR command.
  42. .PP
  43. If \fImode\fR is omitted then it defaults to \fB\-glob\fR.
  44. .VE
  45.  
  46. .SH KEYWORDS
  47. list, match, pattern, regular expression, search, string
  48.